﻿namespace EyeOpen.Validation.Mapping
{
    using System.Collections.Generic;

    /// <summary>
    /// Defines a validation mapping for a property.
    /// </summary>
    public abstract class PropertyMap
    {
        private readonly IList<IValidator> validators = new List<IValidator>();

        protected PropertyMap(string propertyName)
        {
            PropertyName = propertyName;
        }

        /// <summary>
        /// Gets or sets the name of the property.
        /// </summary>
        /// <value>The name of the property.</value>
        public string PropertyName
        {
            get; 
            set;
        }

        /// <summary>
        /// Gets validators.
        /// </summary>
        /// <value>Validators.</value>
        public IEnumerable<IValidator> Validators
        {
            get
            {
                return validators;    
            }
        }

        protected void AddValidator(IValidator validator)
        {
            validators.Add(validator);
        }
    }
}